package conf2.model;

/**
 *
 * @author Administrator
 */
public enum EActor {

    C_FRODO(Side.LIGHT, false, 1),
    C_SAM(Side.LIGHT, false, 2),
    C_MERRY(Side.LIGHT, false, 2),
    C_PIPPIN(Side.LIGHT, false, 1),
    C_ARAGORN(Side.LIGHT, false, 4),
    C_LEGOLAS(Side.LIGHT, false, 3),
    C_GIMLI(Side.LIGHT, false, 3),
    C_BOROMIR(Side.LIGHT, false, 0),
    C_GANDALF(Side.LIGHT, false, 5),
    C_CAVETROLL(Side.DARK, false, 9),
    C_F_NAZGUL(Side.DARK, false, 3),
    C_B_RIDERS(Side.DARK, false, 3),
    C_WITCHKING(Side.DARK, false, 5),
    C_WARG(Side.DARK, false, 2),
    C_ORCS(Side.DARK, false, 2),
    C_SHELOB(Side.DARK, false, 5),
    C_SARUMAN(Side.DARK, false, 4),
    C_BALROG(Side.DARK, false, 5),
    V_FRODO(Side.LIGHT, true, 1),
    V_SAM(Side.LIGHT, true, 1),
    V_ELROND(Side.LIGHT, true, 3),
    V_GANDALF(Side.LIGHT, true, 5),
    V_FARAMIR(Side.LIGHT, true, 3),
    V_TREEBEARD(Side.LIGHT, true, 4),
    V_ARAGORN(Side.LIGHT, true, 4),
    V_THEODEN(Side.LIGHT, true, 2),
    V_SMEAGOL(Side.LIGHT, true, 1),
    V_WORMTONGUE(Side.DARK, true, -1),
    V_GOLLUM(Side.DARK, true, 0),
    V_SARUMAN(Side.DARK, true, 3),
    V_URUKHAI(Side.DARK, true, 4),
    V_ORCS(Side.DARK, true, 3),
    V_MOUTHOFSAURON(Side.DARK, true, 3),
    V_WATCHER(Side.DARK, true, 6),
    V_F_NAZGUL(Side.DARK, true, 5),
    V_WITCHKING(Side.DARK, true, 2);
    public static final EActor[] LIGHT_ACTORS;
    public static final EActor[] DARK_ACTORS;
    public static final EActor[] CLASSIC_LIGHT;
    public static final EActor[] CLASSIC_DARK;
    public static final EActor[] VARIANT_LIGHT;
    public static final EActor[] VARIANT_DARK;


    static {
        LIGHT_ACTORS = new EActor[]{
                    C_FRODO, C_SAM, C_MERRY, C_PIPPIN, C_GIMLI, C_LEGOLAS, C_ARAGORN, C_GANDALF, C_BOROMIR,
                    V_FRODO, V_SAM, V_ARAGORN, V_GANDALF, V_FARAMIR, V_SMEAGOL, V_THEODEN, V_TREEBEARD, V_ELROND
                };
        DARK_ACTORS = new EActor[]{
                    C_CAVETROLL, C_WARG, C_BALROG, C_WITCHKING, C_SARUMAN, C_SHELOB, C_B_RIDERS, C_F_NAZGUL, C_ORCS,
                    V_WATCHER, V_WITCHKING, V_WORMTONGUE, V_ORCS, V_URUKHAI, V_SARUMAN, V_GOLLUM, V_F_NAZGUL, V_MOUTHOFSAURON
                };
        CLASSIC_LIGHT = new EActor[]{
                    C_FRODO, C_SAM, C_MERRY, C_PIPPIN, C_GIMLI, C_LEGOLAS, C_ARAGORN, C_GANDALF, C_BOROMIR
                };
        CLASSIC_DARK = new EActor[]{
                    C_CAVETROLL, C_WARG, C_BALROG, C_WITCHKING, C_SARUMAN, C_SHELOB, C_B_RIDERS, C_F_NAZGUL, C_ORCS
                };
        VARIANT_LIGHT = new EActor[]{V_FRODO, V_SAM, V_ARAGORN, V_GANDALF, V_FARAMIR, V_SMEAGOL, V_THEODEN, V_TREEBEARD, V_ELROND
                };
        VARIANT_DARK = new EActor[]{
                    V_WATCHER, V_WITCHKING, V_WORMTONGUE, V_ORCS, V_URUKHAI, V_SARUMAN, V_GOLLUM, V_F_NAZGUL, V_MOUTHOFSAURON
                };

    }

    public Side getOpposingSide() {
        return (side == Side.LIGHT ? Side.DARK : Side.LIGHT);
    }

    public enum Side {

        DARK, LIGHT;

        static Side opposing(Side side) {
            return side == DARK ? LIGHT : DARK;
        }
    }
    private Side side;
    private boolean isVariant;
    private int defaultAttackValue;

    EActor(Side side, boolean isVariant, int defaultAttackValue) {
        this.side = side;
        this.isVariant = isVariant;
        this.defaultAttackValue = defaultAttackValue;
    }

    public boolean isVariant() {
        return isVariant;
    }

    public Side getSide() {
        return side;
    }

    public boolean isDark() {
        return side == Side.DARK;
    }

    public int getDefaultAttackValue() {
        return defaultAttackValue;
    }

    public boolean isLight() {
        return side == Side.LIGHT;
    }
}
